
package org.jhotdraw.samples.phototemplate.validation;

import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JTextField;

/**
 *
 * @author Eliazar
 */


public class NumberInputVerifier extends InputVerifier {

    @Override
    public boolean verify(JComponent input) {
        JTextField field = (JTextField) input;
        try {
            Double.valueOf(field.getText());
        }catch(NumberFormatException exception)  {
            return false;
        }
        return true;
    }
    
}
